Skip to content

test(omchem): improve automated test coverage for OMChem unit operations and Flowsheet simulation - #142

Merged
Koyandechirag merged 2 commits into
FOSSEE:masterfrom
muaviz:test/omchem-coverage
Nov 13, 2026
Merged

Koyandechirag merged 2 commits into
FOSSEE:masterfrom
muaviz:test/omchem-coverage

Conversation

@muaviz

@muaviz muaviz commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

This PR significantly expands automated unit test coverage for the OMChem package and its core simulation orchestrator (Flowsheet) and achieves 100% test coverage across all OMChem runtime modules.

Key Improvements

  1. OMChem Unit Operations (tests/test_omchem_models.py):

    • Added comprehensive tests for DistCol and ShortcutColumn covering OM_Flowsheet_Init and OM_Flowsheet_Eqn across diverse modes (reflux ratio vs. temperature/side-draw,
      single/multiple feeds, total vs. partial condenser, and energy streams Qcond/Qreb).
    • Covered AdiabaticCompressor and AdiabaticExpander across all supported modes (pressInc, outP, reqPow, pressDrop, genPow).
    • Added complete coverage for CompSep, Heater, Cooler, Pump, Valve, Flash, Mixer, Splitter, and EngStm parameter getters/setters, getname(), modesList(),
      and energy flow (enFlo) equation handling.
  2. Flowsheet Simulation Lifecycle (tests/test_flowsheet.py):

    • Covered Sequential-Modular (SM) simulation lifecycle (simulate_SM and send_for_simulation_SM), validating topological sort resolution across all 4 branching conditions,
      stream property updates (stm.Prop), and multi-unit CSV aggregation into FlowsheetSEQ.csv.
    • Covered Equation-oriented (EQN) execution with mock OpenModelica (omc) processes, package.order synchronization, and cleanup of stray .mo files.
    • Tested Windows and Linux dynamic path resolution for omc, startup flags, error decoder fallbacks, and CSV result parsing edge cases.

@Koyandechirag
Koyandechirag merged commit 92653f0 into FOSSEE:master Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants